<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script>
        //电脑
        var computer = {
            color: "red",
            wigth: "3kg",
            pinpai: "huawei",
            xinghao: "31154-2",
            move: function() {
                console.log("看电影");
                console.log("打游戏");
                console.log("敲代码");
            }
        }
        console.log(computer.color);
        console.log(computer["pinpai"]);
        for (var key in computer) {
            console.log(key);
        }
        var button = new Object();
        button.width = 300;
        button.hight = 400;
        button.backgroundcolor = "pink";
        button.onlick = function() {
            console.log("点击");
        }
        console.log(button.width);
        button.onlick();

        function Car(width, color, paizi) {
            this.width = width;
            this.color = color;
            this.paizi = paizi;
            this.job = function() {
                console.log("载人");
                console.log("拉货");
                console.log("耕田");
            }
        }
        var car = new Car("300", "red", "huawei");
        console.log(car.width);
        car.job();
        for (var key in car) {
            console.log(key);
        }
    </script>
</head>

<body>

</body>

</html>